// $Id: expression.h 21 2015-02-06 01:02:05Z robim.poa@gmail.com $
//-----------------------------------------------------------------------------
// Purpose: Interpretation of code expressions.
// $Rev: 21 $
// $Author: robim.poa@gmail.com $
// $Date: 2015-02-06 01:02:05 +0000 (Fri, 06 Feb 2015) $

#ifndef EXPRESSION_H
#define EXPRESSION_H

#include "ast.h"

#include "text_decoding.h"
#include "text_processing.h"

#define ARITHMETIC_HIERARCHY_LOGIC 1
#define ARITHMETIC_HIERARCHY_COMPARE 2
#define ARITHMETIC_HIERARCHY_TERM 3
#define ARITHMETIC_HIERARCHY_COEFFICIENT 4
#define ARITHMETIC_HIERARCHY_FACTOR 5

void PrintExpressionArray(struct tp_node_expression *node_expression_head);

struct node_ast* BuildExpressionTree(struct tp_node_expression *node_expression_head);

int ExpressionSplit(struct tp_node_expression *node_expression_head1, struct tp_node_expression **node_expression_head2, int arithmetic_hierarchy);

int HierarchyCompare(int arithmetic_hierarchy, int);

int RemoveParentheses(struct tp_node_expression **node_expression_head);

#endif